package org.mac.test;

import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.mac.time.Timer;

public class MybatisTest1 {
	public static void main(String[] args) throws Exception{
		
		String resource = "mybatis-config.xml";
		InputStream inputStream = Resources.getResourceAsStream(resource);
		SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
		SqlSession session = sqlSessionFactory.openSession();
      
		
		Timer timer = session.getMapper(Timer.class);
		System.out.println("timer : " + timer.getMyTime());
		
	
		
		
		
		
		session.close();
		
		
		
		
	
	}
}
